﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Billing
{
    public static class Profile
    {
        private static string userName;
        public static string UserName
        {
            get { return Profile.userName; }
            set { Profile.userName = value; }
        }

        private static int? userID;
        public static int? UserID
        {
            get { return Profile.userID; }
            set { Profile.userID = value; }
        }

        private static Guid? userGUID;
        public static Guid? UserGUID
        {
            get { return Profile.userGUID; }
            set { Profile.userGUID = value; }
        }

        private static int? mAltaUserID;
        public static int? AltaUserID
        {
            get { return Profile.mAltaUserID; }
            set { Profile.mAltaUserID = value; }
        }

        private static int? mDepartmentID;
        public static int? DepartmentID
        {
            get { return Profile.mDepartmentID; }
            set { Profile.mDepartmentID = value; }
        }

        private static Version mVersion;
        public static Version Version
        {
            get { return Profile.mVersion; }
            set { Profile.mVersion = value; }
        }

        private static Guid? mSessionGUID;
        public static Guid? SessionGUID
        {
            get { return Profile.mSessionGUID; }
            set { Profile.mSessionGUID = value; }
        }

        private static string passwordHash;

        public static string PasswordHash
        {
            get { return Profile.passwordHash; }
            set { Profile.passwordHash = value; }
        }

        private static KeyValueList mConstants = new KeyValueList();

        public static KeyValueList Constants
        {
            get { return Profile.mConstants; }
            set { Profile.mConstants = value; }
        }

        private static bool? appSettingsSecurityEnabled = null;

        public static bool AppSettingsSecurityEnabled
        {
            get
            {
                if (appSettingsSecurityEnabled == null)
                {
                    string appSettingsValue = ConfigurationManager.AppSettings.Get("securityEnabled");
                    if (string.IsNullOrEmpty(appSettingsValue))
                        appSettingsSecurityEnabled = false;
                    else
                        appSettingsSecurityEnabled = Convert.ToBoolean(appSettingsValue);
                }
                return appSettingsSecurityEnabled.Value;
            }
        }

        public static string UserFullName { get; set; }
    }
}

